function IntegralProgrammeView() {
    var _this = this;

    _this.init = function () {
        $(".nav").hide();
        $("#startTime").val(TimeUtil.longMsTimeConvertToDateTime($("#startTime").val()));
        $("#endTime").val(TimeUtil.longMsTimeConvertToDateTime($("#endTime").val()));

        _this.initRules();
    };

    _this.initRules = function () {
        //登录
        var integralRule7 = $("#integralRule7").val();
        if(integralRule7!=''){
            var json = eval("("+integralRule7+")");

            $("#nextDay7").val(json.nextDay);
            var arr = json.loginRule;
            $("#addOrDelOptions tr").each(function (i) {
                var obj = $(this);
                if(i<arr.length-1){
                    obj.css("display","block");
                }
            });
            for(var i=0;i<arr.length;i++){
                var arrDay = arr[i].day;
                var arrScore = arr[i].score;
                if(arrDay == "1"){
                    $("#score7").val(arrScore);
                } else {
                    var array = arrDay.split("-");
                    $("#day7_"+i+"_1").val(array[0]);
                    $("#day7_"+i+"_2").val(array[1]);
                    $("#score7_"+i).val(arrScore);
                }
            }
        }
        //考试积分
        var integralRule8 = $("#integralRule8").val();
        if(integralRule8!=''){
            var json = eval("("+integralRule8+")");

            $("#score8").val(json.score);
            if(json.dayLimit=='1'){
                $("input[name='dayLimit8'][value='1']").attr("checked","checked");
            }else {
                $("input[name='dayLimit8'][value='2']").attr("checked","checked");
                $("#dayLimitScore8").val(json.dayLimitScore);
            }
        }
        //学时积分
        var integralRule9 = $("#integralRule9").val();
        if(integralRule9!=''){
            var json = eval("("+integralRule9+")");

            $("#studytime9").val(json.studytime);
            $("#score9").val(json.score);
            $("#studytimeMin9").val(json.studytimeMin);
            if(json.dayLimit=='1'){
                $("input[name='dayLimit9'][value='1']").attr("checked","checked");
            }else {
                $("input[name='dayLimit9'][value='2']").attr("checked","checked");
                $("#dayLimitScore9").val(json.dayLimitScore);
            }
        }
        //自学积分
        var integralRule10 = $("#integralRule10").val();
        if(integralRule10!=''){
            var json = eval("("+integralRule10+")");

            $("#studytime10").val(json.studytime);
            $("#score10").val(json.score);
            $("#studytimeMin10").val(json.studytimeMin);
            if(json.dayLimit=='1'){
                $("input[name='dayLimit10'][value='1']").attr("checked","checked");
            }else {
                $("input[name='dayLimit10'][value='2']").attr("checked","checked");
                $("#dayLimitScore10").val(json.dayLimitScore);
            }
        }


        //每日一练
        var integralRule16 = $("#integralRule16").val();
        if(integralRule16!=''){
            var json = eval("("+integralRule16+")");
            // $("#score16").attr("data-value",json.score);
            $("#score16").val(json.score);
            /*if(json.dayLimit=='1'){
                $("input[name='dayLimit16'][value='1']").attr("checked","checked");
            }else {
                $("input[name='dayLimit16'][value='2']").attr("checked","checked");
            }*/
        }


    };

}

var integralProgrammeView = new IntegralProgrammeView();